import 'package:flutter_taotaoshipin/http/request/app_config_request.dart';
import 'package:flutter_taotaoshipin/http/request/app_ios_inspect_request.dart';
import 'package:flutter_taotaoshipin/model/app_config_entity.dart';
import 'package:flutter_taotaoshipin/model/base_entity.dart';
import 'package:flutter_taotaoshipin/util/device_utils.dart';
import 'package:hi_net/hi_net.dart';

class AppDao {
  /// 剧集购买
  static Future<BaseEntity> iosInspect() async {
    var request = AppIosInspectRequest();
    request.add('app_version', Device.packageInfo.version);
    request.add('api_version', '1.0');
    request.add('udid', Device.udid());
    request.add('oaid', Device.oaid());
    var result = await HiNet.getInstance().fire(request);
    return BaseEntity.fromJson(result);
  }

  /// 获取app配置参数接口
  static Future<BaseEntity<AppConfigEntity>> config() async {
    var request = AppConfigRequest();
    var result = await HiNet.getInstance().fire(request);
    return BaseEntity<AppConfigEntity>.fromJson(result);
  }
}
